﻿using Microsoft.AspNetCore.Mvc;
using web01.Models;

namespace web01.Controllers
{
    /*
     *Http 请求传递
     * Aso.Net  Request.Form("");
     * 
     * Aso.Net core mvc （模型绑定）将 HTTP 请求参数(get post) action参数名称对应参数进行绑定---IBindModel 绑定
     *
     *
     * ModelState 模型绑定状态
     * 
     */
    public class BindController : Controller
    {
        public IActionResult Index() //将请求id
        {
            return View();
        }
        
        public IActionResult A() //将请求id
        {
            return View();
        }
        
        // GET
        [HttpPost]
        public IActionResult Index(Person person) //将请求id
        {
            bool valid = ModelState.IsValid;
            
            return View();
        }
    }
}